import request from '@/utils/request'

export default {
    // 1.添加课程信息
    addCourseInfo(courseInfo) {
        return request({
            url: `/eduservice/course/addCourseInfo`,
            method: 'post',
            data: courseInfo
        })
    },
    // 2.查询所有讲师列表
    findAllTeacher() {
        return request({
            url: `/eduservice/teacher/findAll`,
            method: 'get'
        })
    },
    // 3.根据课程ID查询课程信息
    getCourseById(courseId) {
        return request({
            url: `/eduservice/course/getCourseById/${courseId}`,
            method: 'get'
        })
    },
    // 4.根据课程ID修改课程信息
    updateCourseInfo(courseInfo) {
        return request({
            url: `/eduservice/course/updateCourseInfo`,
            method: 'post',
            data: courseInfo
        })
    },
    // 5.根据课程ID显示课程确认信息
    getCoursePublishInfo(id) {
      return request({
        url: `/eduservice/course/getCoursePublishInfo/${id}`,
        method: 'get'
      })
    },
    // 6.课程最终发布
    publishCourse(id) {
      return request({
        url: `/eduservice/course/publishCourse/${id}`,
        method: 'post'
      })
    },
    // 7.课程条件分页列表
    getPageList(page, limit, searchObj) {
      return request({
        url: `/eduservice/course/${page}/${limit}`,
        method: 'get',
        params: searchObj
      })
    },
    // 8.删除课程
    deleteCourse(courseId) {
      return request({
        url: `/eduservice/course/${courseId}`,
        method: 'delete'
      })
    }
}


